<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('account_log_list'); $starttimer = microtime(true);
$checkPagenum = isset($checkPagenum)? $checkPagenum  : $cfg_pagenum;
$action = isset($action) ? $action : 'account_log';

?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>帐户变动明细</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<link href="templates/css/pagination.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/layindex.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" src="templates/js/forms.func.js"></script>
<script type="text/javascript">

function checkPagenum(id)
{	
	var pn = document.getElementById(id).value; 
	var url=window.location.search;
	location.href=changeURLArg(url,'checkPagenum',pn);
};

function func(id){
 //获取被选中的option标签
	var val = $('#'+id+' option:selected').val();
	var url=window.location.search;
	location.href=changeURLArg(url,id,val);
};
</script>
</head>

<body class="mainbody">
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <span>会员日志</span>
  <i class="arrow"></i>
  <span>帐户变动明细</span>
  <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<!--/导航栏-->

<!--工具栏-->
<div id="floatHead" class="toolbar-wrap">
  <div class="toolbar">
    <div class="box-wrap">
      <a class="menu-btn"></a>
      <div class="l-list">
        <ul class="icon-list">
		 <?php if(IsModel($action,'add',1)!=false) echo'<li><a class="add" href="member_account_add.php"><i></i><span>新增</span></a></li>';?>
          <li><a class="all" href="javascript:;" onclick="checkAll(this);"><i></i><span>全选</span></a></li>
		 <?php if(IsModel($action,'del',1)) echo'<li><a href="javascript:SubUrlParam(\'member_account_save.php?action=delall\')" onclick="return ConfDelAll(0);" class="del"><i></i><span>删除</span></a></li>';?>
        </ul> 
	
      </div>
      <div class="s-list">
	  	  <form name="form3" id="form3" method="post" action="member.php">
	  	<div class="rule-single-select">  
		<select name="process_type"  onchange="func('process_type')"  id="process_type">
			<option selected="selected" value="all">全部记录</option>
			<option <?php if(@$process_type=='0') echo 'selected="selected"';?>value="0">存入</option>
			<option  <?php if(@$process_type=='1') echo 'selected="selected"';?>value="1">支出</option>
			</select>
         </div>

		 <div class="single-select">
        <input name="keyword" type="text" id="keyword" class="keyword" />
		</div> <div class="single-select">
		    <input  class="btn-search" type="submit" value="搜索" style="cursor:pointer;"></div>
		</form>

      </div>
    </div>
  </div>
</div>
<!--/工具栏-->
<form method="post" action="" id="form">
<!--列表-->
<div class="table-container">

  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
    <tr>
		<th width="8%">选择</th>
		<th align="left" width="15%">用户名</th>
		<th align="left"width="10%">金额</th>
		<th align="left" >备注</th>
		<th align="left" width="16%">时间</th>
    </tr>
  
  	<?php
			$sql ="SELECT * FROM `#@__account_log` where id>0 ";

		if(!empty($keyword)) $sql .= " AND username LIKE '%$keyword%'";
		if(!empty($process_type)) 
		{
			if($process_type=='all')
			{
				$sql .='';
			}
			else{$sql .= " and `process_type` =  '$process_type'";}
			
		}
		if(!empty($usergroup)) 
		{
			if($usergroup=='all')
			{
				$sql .='';
			}
			else{$sql .= " and `groupid` =  '$usergroup'";}
			
		}
			if(!empty($checkinfo))
		{
				switch($checkinfo)
			{
				case 'true':
						$sql .= "AND checkinfo='true'";
					break;
				case 'false':
						$sql .= "AND checkinfo='false'";
					break;
				default:
				;
			}
		}
		$dopage->GetPage($sql,$checkPagenum);

		while($row = $dosql->GetArray())
		{
			$usergroup = '';
			$dosql->Execute("SELECT * FROM `#@__usergroup`",$row['id']);
			while($row2 = $dosql->GetArray($row['id']))
			{
				if($row['groupid'] == $row2['id'])
				{
					$usergroup = '<span style="color:'.$row2['color'].'">'.$row2['groupname'].'</span>';
				}
			}

			if($usergroup == '')
			{
				
					$usergroup = '参数获取失败';
				
			}
			
			$oauthico = '';

			if($row['qqid'] != '')
				$oauthico .= '<span class="qqico" title="QQ账号绑定"></span>';

			if($row['weiboid'] != '')
				$oauthico .= '<span class="weiboico" title="微博账号绑定"></span>';
			
			//修改权限
			if(IsModel('member','update',1)==true)
				$updatestr = '<a href="member_update.php?id='.$row['id'].'"">修改</a>';
			else
				$updatestr = '修改';
			
			//删除权限
			if(IsModel('member','del',1)==true)
				$delstr = '<a href="member_save.php?action=del&id='.$row['id'].'" onclick="return ConfDel(0)">删除</a>';
			else
				$delstr = '删除';
			
		?>
		<tr align="center">
			<td ><span class="checkall" style="vertical-align:middle;"><input type="checkbox" name="checkid[]" value="<?php echo $row['id']; ?>" /></span></td>
			<td><?php echo $row['username'];?> </td>
			<td><?php echo $row['username'];?> </td>
		</tr>
		<?php
		}
		?>
		 <?php

//判断无记录样式
if($dosql->GetTotalRow() == 0)
{
	echo '<tr><td align="center" colspan="5">暂无记录</td></tr>';
}
?>
  </table>
</div>
<!--/列表-->
<!--内容底部-->
<div class="line20"></div>
<div class="pagelist">
 <div class="l-btns">
    <span>显示</span><input name="txtPageNum" type="text" value="<?php echo $checkPagenum;?>"  onblur="checkPagenum(this.id)"  onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="txtPageNum" class="pagenum" onkeydown="return checkNumber(event);" /><span>条/页</span>
  </div>
  <?php echo $dopage->GetList($sql); ?>
  <div class="l-btns"><span>
<?php 
$stoptimer = microtime(true);
$timer = $stoptimer-$starttimer;
echo " $timer s";?></span>
</div>
</div>
<!--/内容底部-->
</form>
</body>
</html>
